package com.webcams.ui;

import java.io.IOException;

import android.app.Activity;
import android.content.res.AssetManager;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class AboutUI extends Activity {

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);

		String langSuffix = getResources().getConfiguration().locale.getLanguage();

		WebView mWebView = new WebView(this);
		mWebView.getSettings().setJavaScriptEnabled(true);
		mWebView.setWebViewClient(new WebViewClient() {  
			@Override  
			public boolean shouldOverrideUrlLoading(WebView view, String url)  
			{  
				view.loadUrl(url);
				return true;
			}  
		}); 


		AssetManager mg = getResources().getAssets();
		try {
			mg.open("file:///android_asset/about-"+langSuffix+".html");
			mWebView.loadUrl("file:///android_asset/about-"+langSuffix+".html");
		} catch (IOException ex) {
			mWebView.loadUrl("file:///android_asset/about.html");
		}

		setContentView(mWebView);
	}

}
